Data replication in relational or hierarchical databases is increasingly important as databases are deployed more and more in distributed environments. The goal of data replication is to maintain one or more copies of a source object in the database across servers, possibly on different platforms and geographical locations. One method of data replication is log-based asynchronous replication. A database log records all changes to the tables in the database. Changes are captured from the database log outside of a commit scope of the original database transaction.
FIG. 1 illustrates components of a conventional asynchronous replication process. At each node in the database system is a capture program 102 and an apply program 104. The capture program 102 and the apply program 104 each maintain control tables 106 and 107 at the node. At the node where changes are made is the source database 101 containing a source table (not shown). At the node where the changes are to be replicated is the target database 105 containing the target table (not shown). A message queue 103 is the mechanism used for transporting messages between the source database 101 and the target database 105.
During the replication process, the capture program 102 reads the database log for committed changes to the source database 101. The database log contains the source table and row that was changed, the type of operation, the column data type information, the data value after the change for insert and update operations, and the data value before the change for delete and update operations. These changes are then formatted into messages and sent to the message queue 103 to the target database 105. Upon delivery to the message queue 103, the apply program 104 retrieves the messages and applies the changes to the target database 105.
However, when a change involves large data objects (LOB), some databases provide the option not to record the after or before value of the LOB in the database log. Without the ability to obtain the after or before value of the LOB from the database log, the replication process cannot successfully replicate the change at the target database 105.
Accordingly, there exists a need for a method and system for asynchronously replicating data changes in a database system when the changed data is not available in a database log. The present invention addresses such a need.